package org.openfans.domain;

/**
 * 类说明：一个fans拥有的tag，包括了他使用这个tag的频度<br>
 * 创建时间：2006-5-18<br>
 * 
 * @author 张俊<br>
 * @email:pesome@gmail.com<br>
 */
public class FansUsedTag extends PersistentObject {
	private int id;

	private Fans fans;

	private Tag tag;

	private int freq;

	public FansUsedTag() {
	}

	public FansUsedTag(Fans fans, Tag tag, int freq) {
		super();
		this.fans = fans;
		this.tag = tag;
		this.freq = freq;
	}

	public Fans getFans() {
		return fans;
	}

	public void setFans(Fans fans) {
		this.fans = fans;
	}

	public int getFreq() {
		return freq;
	}

	public void setFreq(int freq) {
		this.freq = freq;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Tag getTag() {
		return tag;
	}

	public void setTag(Tag tag) {
		this.tag = tag;
	}

	public void addFreq(int i) {
		this.freq++;
	}

	/**
	 * 简单的覆写了hashCode方法，给hashSet的contains方法使用
	 */
	public int hashCode() {
		return this.id * 31 + 7;
	}

}
